<template>
    <div>
        <h2>登录页面</h2>
        <p>作者姓名：<input type="text" v-model="name"></p>
        <div>           
              
        </div>
        <p>密 码：<input type="passord" v-model="password"></p>
        <button @click="login()">登录</button>
    </div>
</template>

<script>
import {login} from "../axios_api/api.js"
export default {
    name:"loginbook",
    data() {
        return {
            name:"",
            password:"",
        }
    },
    methods:{
        login(){
            login().then(res=>{
                // if(res.data.code==200){ 
                    console.log(res)
                    this.$router.push({path:"/showbook"})
                // }else{
                //     alert(res.data.msg)
                //     window.location.reload()
                // }
                
            })
        }
    }
}
</script>

<style>

</style>
